package com.sam.designpattern.observer;

/**
 * @Author: Sam
 * @Date: 2022-08-19 14:40
 * @Description: 读者类
 */
public class Reader implements Observer {

    /**
     * 读者姓名
     */
    private String name;

    @Override
    public void update(Subject subject) {
        System.out.println(name + "收到报纸了。内容是【 " + ((NewsPaper) subject).getContent() + " 】");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
